home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / mhs_c.arc / OUTPOST.ARC / NDT.H < prev    next >
C/C++ Source or Header  |  1988-06-27  |  6KB  |  224 lines

  1. #ifdef LC215
  2. #ifndef void
  3. #define void  int
  4. #endif
  5. #ifndef BYTE
  6. #define    BYTE  char
  7. #endif
  8. #ifndef WORD
  9. #define WORD  unsigned
  10. #endif
  11. #ifndef    NULL
  12. #ifdef SPTR
  13. #define NULL 0
  14. #else
  15. #define NULL 0L
  16. #endif
  17. #endif
  18. #endif
  19.  
  20. #ifdef LC300
  21. #ifndef BIG_MEMORY
  22. #define BIG_MEMORY
  23. #ifndef NARGS
  24. #define PROTOTYPE
  25. #endif
  26. #endif
  27. #ifndef BYTE
  28. #define BYTE  unsigned char
  29. #endif
  30. #ifndef WORD
  31. #define WORD  unsigned short
  32. #endif
  33. #ifndef    NULL
  34. #ifdef SPTR
  35. #define NULL 0
  36. #else
  37. #define NULL 0L
  38. #endif
  39. #endif
  40. #endif
  41.  
  42. /*
  43.     if running TURBO 'C' pretend to be Microsoft with prototypes.
  44.     Must replace "func(char *, )" with "func(char *, ...)".  In order
  45.     to do this we use _ELIPSIS_ as a place holder for the variable args.
  46. */
  47. #ifndef _ELIPSIS_
  48. #ifdef __TURBOC__
  49.     #define MSC
  50.     #define LINT_ARGS
  51.     #define _ELIPSIS_ ...
  52. #else
  53. #define _ELIPSIS_
  54. #endif
  55. #endif
  56.  
  57. #ifdef MSC
  58.     #ifndef BIG_MEMORY
  59.         #define BIG_MEMORY
  60.         #ifdef LINT_ARGS
  61.             #define PROTOTYPE
  62.         #endif
  63.     #endif
  64.     #ifndef BYTE
  65.         #define BYTE  unsigned char
  66.     #endif
  67.  
  68.     #ifndef WORD
  69.         #define WORD  unsigned short
  70.     #endif
  71.  
  72.     #ifndef O_RAW
  73.         #define O_RAW O_BINARY
  74.     #endif
  75.  
  76.     #ifndef setmem
  77.         #define setmem(dest, cnt, c)    memset((dest),(c),(cnt))
  78.     #endif
  79.  
  80.     #ifndef movmem
  81.         #define movmem(src, dest, cnt)    memcpy((dest), (src), (cnt))
  82.     #endif
  83.  
  84.     #ifndef strbrk
  85.         #define strbrk(s1, s2)            strpbrk((s1), (s2))
  86.     #endif
  87.  
  88.     #ifndef NPrintF
  89.         #define NPrintF    printf
  90.     #endif
  91.  
  92.     #ifndef    NULL
  93.         #if defined(M_I86LM) || defined(M_I86CM) || defined(M_I86HM)
  94.             #define NULL 0L
  95.         #else
  96.             #define NULL 0
  97.         #endif
  98.     #endif
  99.  
  100.     #ifndef Free
  101.         #define Free(p)    (free(p), 0)
  102.     #endif
  103. #endif
  104.  
  105. #ifdef AZTEC
  106. #ifndef BIG_MEMORY
  107. #define BIG_MEMORY
  108. #endif
  109. #ifndef BYTE
  110. #define BYTE  unsigned char
  111. #endif
  112. #ifndef WORD
  113. #define WORD  unsigned short
  114. #endif
  115. #ifndef    NULL
  116. #if sizeof(char *) == 2
  117. #define NULL 0
  118. #else
  119. #define NULL 0L
  120. #endif
  121. #endif
  122. #ifndef O_RAW
  123. #define O_RAW 0
  124. #endif
  125. #endif
  126.  
  127. #ifndef NOPROC
  128. #define NOPROC ((int (*)())0)
  129. #endif
  130.  
  131. #ifndef TRUE
  132. #define TRUE    1
  133. #define FALSE    0
  134. #endif
  135.  
  136.  
  137. /**** This defines the data structure returned by FindFirst/FindNext calls ****/
  138. typedef struct
  139. {
  140.     /* The first 21 bytes are officially undefined, but the following defini-
  141.        tion is that used if the search is done on a network drive */
  142.     char uniqueID;                      /* if 0x5a, route search to network  */
  143.     char searchMode;                    /* 0 = regular file search with no
  144.                                                subdirectories.
  145.                                            1 = in regular file search, later
  146.                                                add subdirectories.
  147.                                            2 = searching subdirectories
  148.                                            3 = search is done.               */
  149.     int searchCount;                    /* Sequence number for searches      */
  150.     char directoryHandle;               /* Handle of directory being searched*/
  151.     char searchAttribute;               /* Attribute used in search          */
  152.     char searchPatternLength;           /* Length of the search pattern      */
  153.     char searchPattern[13];             /* File pattern being searched for   */
  154.     char server;                        /* Server being searched             */
  155.     /* The following bytes are well defined for both DOS and the network */
  156.     BYTE attributeFound;                /* Attribute of matching file        */
  157.     unsigned fileTime;                  /* Time stamp of file                */
  158.     unsigned fileDate;                  /* Date stamp of file                */
  159.     long fileSize;                      /* Size of file in bytes             */
  160.     char fileName[13];                  /* Name of matching file             */
  161. } FILEINFO;
  162.  
  163. /* File Attributes */
  164. #ifndef FA_READ_ONLY
  165. #define FA_NORMAL                ((BYTE)0x00)
  166. #define FA_READ_ONLY            ((BYTE)0x01)
  167. #define FA_HIDDEN               ((BYTE)0x02)
  168. #define FA_SYSTEM               ((BYTE)0x04)
  169. #define FA_EXECUTE_ONLY         ((BYTE)0x08)
  170. #define FA_DIRECTORY            ((BYTE)0x10)
  171. #define FA_NEEDS_ARCHIVED       ((BYTE)0x20)
  172. #define FA_SHAREABLE            ((BYTE)0x80)
  173. /* Extended file attributes */
  174. #define FA_TRANSACTIONAL    ((BYTE)0x10)
  175. #define FA_INDEXING            ((BYTE)0x20)
  176. #define FA_AUDIT_READ        ((BYTE)0x40)
  177. #define FA_AUDIT_WRITE        ((BYTE)0x80)
  178. #endif
  179.  
  180. /* File Open Modes */
  181. /* Inheritance flag */
  182. #define    IF_INHERITED            (BYTE)0x00
  183. #define    IF_PRIVATE                (BYTE)0x80
  184.     /* Sharing modes */
  185. #define    SM_COMPATIBILITY        (BYTE)0x00
  186. #define    SM_DENY_READ_WRITE        (BYTE)0x10
  187. #define    SM_DENY_WRITE            (BYTE)0x20
  188. #define    SM_DENY_READ            (BYTE)0x30
  189. #define    SM_DENY_NONE            (BYTE)0x40
  190.     /* Access modes */
  191. #define    AM_READ                    (BYTE)0x00
  192. #define    AM_WRITE                (BYTE)0x01
  193. #define    AM_READ_WRITE            (BYTE)0x02
  194.  
  195. /* DOS errors */
  196. #define    DOS_INVALID_FUNCTION_NUMBER                 1
  197. #define    DOS_FILE_NOT_FOUND                          2
  198. #define    DOS_PATH_NOT_FOUND                          3
  199. #define    DOS_TOO_MANY_OPEN_FILES                     4
  200. #define    DOS_ACCESS_DENIED                           5
  201. #define    DOS_INVALID_FILE_HANDLE                     6
  202. #define    DOS_MEMORY_BLOCKS_DESTROYED                 7
  203. #define    DOS_INSUFFICIENT_MEMORY                     8
  204. #define    DOS_INVALID_MEMORY_BLOCK_ADDR                9
  205. #define    DOS_INVALID_ENVIRONMENT                    10
  206. #define    DOS_INVALID_FORMAT                         11
  207. #define    DOS_INVALID_ACCESS_CODE                    12
  208. #define    DOS_INVALID_DATA                           13
  209. #define    DOS_INVALID_DRIVE_SPECIFIED                15
  210. #define    DOS_ATTEMPT_TO_DEL_CURRENT_DIR                  16
  211. #define    DOS_NOT_SAVE_DEVICE                        17
  212. #define    DOS_NO_MORE_FILES                          18
  213.  
  214. extern BYTE DOSError;    /* Used to return DOS Errors from INT 21 calls */
  215.  
  216. #ifdef BIG_MEMORY
  217. #ifdef PROTOTYPE
  218. extern int FindFirstFile(char *, FILEINFO *, char);
  219. extern int FindNextFile(FILEINFO *);
  220. #else
  221. extern int FindFirstFile();
  222. extern int FindNextFile();
  223. #endif
  224.